package com.zkc.stume.service;

import com.zkc.stume.bean.Dat;
import com.zkc.stume.dao.DatMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DatService {



    @Autowired
    private DatMapper datMapper;

    /*curd 查*/
    public List<Dat> getAll(){
     return datMapper.selectByExampleWithBLOBss(null);
    }

    /*根据id单个查询*/
    public Dat datdan(Integer id){
        return datMapper.selectByPrimaryKey(id);
    }

    /*修改*/
    public Integer xiugai(Dat dat){
        return datMapper.updateByPrimaryKeySelective(dat);
    }

    /*增加*/

    public Integer zengjia(Dat dat){
        return datMapper.insertSelective(dat);
    }

    /*删*/
    public Integer shanchu(Integer id){
        return datMapper.deleteByPrimaryKey(id);
    }

}
